home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 38 / 038.d81 / tinted tiles (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  105 lines

  1. 0 gosub720:clr
  2. 10 dima$(16):dime(16):dimc(5,5)
  3. 20 ct=1:poke 53280,.:poke53281,.
  4. 30 print"[147][158]              tinted tiles"
  5. 31 print"            by  joel epstein"
  6. 32 print"          p [154]- play tinted tiles"
  7. 34 print"          q [154]- quit"
  8. 36 print"          press p [154]or q[154]."
  9. 37 a=peek(203):ifa<>41anda<>62then37
  10. 38 ifa=62thengosub60000:goto36
  11. 39 print"    please wait -- scrambling tiles"
  12. 40 a$(16)="[144]   [157][157][157]   [157][157][157]   [145][145]"
  13. 50 a$(1)="   [157][157][157] a [157][157][157]   [145][145]"
  14. 60 a$(2)="   [157][157][157] b [157][157][157]   [145][145]"
  15. 70 a$(3)="[159]   [157][157][157] c [157][157][157]   [145][145]"
  16. 80 a$(4)="[156]   [157][157][157] d [157][157][157]   [145][145]"
  17. 90 a$(5)="   [157][157][157] e [157][157][157]   [145][145]"
  18. 100 a$(6)="   [157][157][157] f [157][157][157]   [145][145]"
  19. 110 a$(7)="[158]   [157][157][157] g [157][157][157]   [145][145]"
  20. 120 a$(8)="[129]   [157][157][157] h [157][157][157]   [145][145]"
  21. 130 a$(9)="[149]   [157][157][157] i [157][157][157]   [145][145]"
  22. 140 a$(10)="[150]   [157][157][157] j [157][157][157]   [145][145]"
  23. 150 a$(11)="[151]   [157][157][157] k [157][157][157]   [145][145]"
  24. 160 a$(12)="[152]   [157][157][157] l [157][157][157]   [145][145]"
  25. 170 a$(13)="[153]   [157][157][157] m [157][157][157]   [145][145]"
  26. 180 a$(14)="[154]   [157][157][157] n [157][157][157]   [145][145]"
  27. 190 a$(15)="[155]   [157][157][157] o [157][157][157]   [145][145]"
  28. 195 fora=1to15:e(a)=.:next:z=0
  29. 200 fora=1to4:forb=1to4
  30. 210 c(a,b)=int(rnd(0)*16)
  31. 220 ford=0to15
  32. 230 if e(d)=c(a,b) then 210
  33. 240 next d
  34. 250 e(z)=c(a,b):z=z+1
  35. 260 if z=15 then goto280
  36. 270 nextb:nexta
  37. 280 print
  38. 290 c(4,4)=16
  39. 300 poke 53280,6:print"[147][158]              tinted tiles"
  40. 305 print"            by  joel epstein"
  41. 306 print" press letter of tile you wish to move."
  42. 307 print"[154]            press q [154]to quit."
  43. 310 print"";
  44. 320 fora=1to4:forb=1to4
  45. 330 g=c(a,b):printa$(g);
  46. 340 nextb:print:print:print:print"";:nexta:poke198,.
  47. 350 print"          [154]number of moves:"ct-1
  48. 360 get qq$:ifqq$=""then360
  49. 370 ifqq$="q"orqq$="[209]"thengosub60100:if(ok)then20
  50. 400 h=(asc(qq$)-64)
  51. 410 if h<0 or h>15 then goto 350
  52. 420 fora=1to4:forb=1to4
  53. 430 if c(a,b)=h then goto 460
  54. 440 nextb:nexta
  55. 450 goto350
  56. 460 ifc(a+1,b)=16thenc(a+1,b)=h:c(a,b)=16:goto510
  57. 470 ifc(a-1,b)=16thenc(a-1,b)=h:c(a,b)=16:goto510
  58. 480 ifc(a,b+1)=16thenc(a,b+1)=h:c(a,b)=16:goto510
  59. 490 ifc(a,b-1)=16thenc(a,b-1)=h:c(a,b)=16:goto510
  60. 500 goto350
  61. 510 print"";
  62. 520 fora=1to4:forb=1to4
  63. 530 g=c(a,b):printa$(g);
  64. 540 nextb:print:print:print:print"";:nexta
  65. 550 ct=ct+1
  66. 560 jj=1
  67. 570 fora=1to4:forb=1to4
  68. 580 ifc(a,b)<>jj then goto 350
  69. 590 jj=jj+1
  70. 600 nextb:nexta
  71. 610 print"[154]   hooray!! you won in only"ct-1"[154]moves"
  72. 630 print"     [154]press space [154]to return to menu"
  73. 640 ifpeek(203)<>60then640
  74. 650 goto20
  75. 690 fora=1to4:forb=1to4:c(a,b)=0:nextb:nexta
  76. 700 if qq$="*" then print"sorry, but you lost":print"in";ct-1;"moves"
  77. 710 ct=1:forxx=0to15:e(xx)=0:nextxx:g=0:jj=0:h=0:z=0:forf=1to1500:next:goto65535
  78. 720 poke53280,14:poke53281,14
  79. 730 printchr$(142)"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
  80. 740 fora=1to23:print"[221]"spc(38)"[221]";:next
  81. 750 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][157][148][192]"
  82. 760 fora=217to242:pokea,peek(a)or128:next
  83. 770 print"          loadstar presents:"
  84. 780 print"                               "
  85. 790 print"             tinted tiles       "
  86. 800 print"                                "
  87. 810 print"           by  joel epstein     "
  88. 820 print"                                "
  89. 830 print"            copyright 1987      "
  90. 840 print"                                "
  91. 850 print"                                "
  92. 860 print"        press space to continue"
  93. 870 ifpeek(203)<>60then870
  94. 880 return
  95. 60000 print"[145]  [154]are you sure you want to quit? (y[154]/n[154])"
  96. 60010 a=peek(203):ifa<>25anda<>39then60010
  97. 60020 ifa=39thenprint"[145]                                      [145]":return
  98. 60030 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  99. 60040 ifer<>63thenend
  100. 60050 load"hello connect",8
  101. 60100 print"  [154]are you sure you want to quit? (y[154]/n[154])"
  102. 60110 a=peek(203):ifa<>25anda<>39then60110
  103. 60120 ok=.:ifa=39thenprint"[145]            [154]press q[154] to quit.          ":return
  104. 60130 ok=1:return
  105.